package experiment11;

import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.layout.Pane;
import javafx.scene.paint.Color;
import javafx.scene.shape.Circle;
import javafx.stage.Stage;

public class No_1 extends Application {

    public static void main(String[] args) {
        launch(args);
    }

    @Override
    public void start(Stage primaryStage) {
        Pane pane=new Pane();

        Circle circle=new Circle(50,50,50);
        circle.setFill(Color.WHITE);
        circle.setStroke(Color.BLACK);

        pane.getChildren().add(circle);

        Scene scene=new Scene(pane);

        scene.setOnMousePressed(event -> {
            circle.setFill(Color.BLACK);
        });
        scene.setOnMouseReleased(event -> {
            circle.setFill(Color.WHITE);
        });

        primaryStage.setTitle("circle change color");
        primaryStage.setScene(scene);
        primaryStage.show();
    }
}
